<%@ page language="java" contentType="text/html; charset=utf-8"%>
<%@ include file="/commons/taglibs.jsp"%>
<%@ include file="/commons/commonList.jsp" %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title></title>
<script language="JavaScript"  src="${ctx}/scripts/common.js"></script>
<script language="JavaScript" type="text/javascript" src="${ctx}/scripts/common/prototype.js"></script>
<script>
var standardName = null;
var chargeItemId = null;
var id = null;
function openStandardAdd(){
	var url = encodeURI(encodeURI("${ctx}/charge_chargeStandardAction.do?method=initOtherStandardAdd&chargeItemName="+standardName+"&chargeItemId="+chargeItemId));
	top.windowOpen(url,"openStandardAdd","${key.addOther}",350,700);
}
function openStandardEdit(){
    if(id == null)
	{
		ErrorAlert("${key.tipsByModify}");
		return false;
	}
	else
	{
		var url = encodeURI(encodeURI("${ctx}/charge_chargeStandardAction.do?method=initOtherStandardEdit&keyword="+id+"&chargeItemName="+standardName+"&chargeItemId="+chargeItemId));
		top.windowOpen(url,"openStandardEdit","${key.editOther}",350,700);
	}
}
function showDelete(){
	if(id == null)
	{
		ErrorAlert("${key.tipsByDelete}");
		return false;
	}
	else
	{
		AlarmConfirm('${key.tipsByDeleteConfirm}',"chargeItemMainFrame","deleteStandard");
	}
}
function deleteStandard(){
	var str = "keyword="+id;
	var myAjax = new Ajax.Request("${ctx}/charge_chargeStandardAction.do?method=deleteOtherStandard",
               {method: 'post', parameters: str, onComplete: function(response) {
                 if('true' == response.responseText){
					freshStandardList();
               	 }
               	 else
               	   ajaxSubmitException(response.responseText);
               	}}
               );
}
function freshStandardList(){
	 parent.chargeItemMainFrame.location.reload();
}
function init(){
	standardName =  parent.getStandardName();
	chargeItemId = parent.getChargeItemId();
}
function setStandard(cid){
	id= cid;
}
function showDetail(cid)
{
	var url = "${ctx}/charge_chargeStandardAction.do?method=getOtherStandardDetailById&keyword="+id;
    top.windowOpen(url, "ChargeStandardDetail", "${key.otherInfo}", 350, 700);
}
function getPageNO()
{
	return document.getElementById("ec_p").value;
}
</script>
</head>
<body onload="init()">
<div class="container">
<table border="0" cellspacing="0" cellpadding="0"  width="100%" class="bg_search" id="search01" >
      <tr>
        <td>&nbsp;</td>
      </tr>
</table>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
    <tr>
      <td class="bg_toolBar">
        <table border="0" cellpadding="0" cellspacing="0">
        <tr>
			<td class="toolbarico"><a href="#"  onclick="openStandardAdd();" onfocus="this.blur()"><img src="${ctx}/images/ico_newfile.gif" border="0" align="absbottom" alt="${key.addStandard}"/>&nbsp;</a></td>
			<td class="toolbarico"><a href="#"  onclick="openStandardEdit();" onfocus="this.blur()"><img src="${ctx}/images/ico_amend.gif" alt="${key.editStandard}" width="16" height="16" border="0" align="absbottom" /></a></td>
			<td class="toolbarico"><a href="#" onClick="showDelete();" onFocus="this.blur()"><img src="${ctx}/images/ico_delete.gif" alt="${key.deleteStandard}" width="16" height="16" border="0" align="absbottom"></a></td>
        </tr>
        </table>
       </td>
    </tr>
    <tr>
      <td valign="top">
			<ec:ceTable
			    items="standardList"
				action="${ctx}/charge_chargeStandardAction.do?method=initChargeStandardListBy&chargeItemId=${standardItem.chargeItemId}&chargeItemType=${chargeItemType}"
				var="standardItem"
				view="pmsview"
				styleClass="gridData2"
				rowsDisplayed="15">
				<ec:ceRow styleClass="grid"  onclick="setStandard('${standardItem.keyword}')" ondblclick="showDetail('${standardItem.keyword}')" onContextMenu="return ShowContextMenu(event,'quick_rightmenu')">
					<ec:ceColumn headerCell="pmsHeadrCell" title="${key.staName}" property="staName"  width="12%">
						<c:out value="${standardItem.staName}"></c:out>
					</ec:ceColumn>
				</ec:ceRow>
			</ec:ceTable>
       </td>
    </tr>
  </table>
</div>
<div id="quick_rightmenu" style="display:none;" oncontextmenu="return false" class="quick_rightmenu">
  <table width="100%" border="0" cellpadding="1" cellspacing="0" class="grid_quickMenu_bg">
    <tr>
      <td><table width="100%" border="0" cellpadding="2" cellspacing="0">
        <tr>
          <td class="quickMenu_toolbarico"><a href="#" onclick="openStandardAdd();" onfocus="this.blur()"><img src="${ctx}/images/ico_newfile.gif" border="0" align="absbottom" alt="${key.add}"/> ${key.add} </a></td>
          </tr>
        <tr>
          <td class="quickMenu_toolbarico"><a href="#" onClick="openStandardEdit();" onFocus="this.blur()"><img src="${ctx}/images/ico_amend.gif"  width="16" height="16" border="0" align="absbottom" />${key.modify}</a></td>
          </tr>
        <tr>
          <td class="quickMenu_toolbarico"><a href="#" onClick="showDelete();" onFocus="this.blur()"><img src="${ctx}/images/ico_delete.gif" alt="${key.delete}" width="16" height="16" border="0" align="absbottom"> ${key.delete}</a></td>
          </tr>
      </table></td>
    </tr>
  </table>
</div>



</body>
</html>
